package cn.pw.test.com.news.adapter;

import android.widget.ImageView;

import com.avos.avoscloud.AVObject;
import com.avos.avoscloud.AVUser;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import cn.pw.test.com.news.R;
import cn.pw.test.com.news.bean.NewsCommentBean;
import tech.com.commoncore.manager.GlideManager;

public class NewsCommentAdapter extends BaseQuickAdapter<NewsCommentBean, BaseViewHolder> {

    public NewsCommentAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, NewsCommentBean item) {
        ImageView headImg = helper.itemView.findViewById(R.id.comment_item_user_head);

        helper.setText(R.id.comment_item_user_name, item.getName());
        helper.setText(R.id.comment_item_date, item.getCreatedAt());
        helper.setText(R.id.comment_item_content, item.getContent());

        GlideManager.loadCircleImg(item.getAvatar(), headImg, R.mipmap.icon_default_head);
    }
}
